//
//  AppDelegate+IM.m
//  HBuilder
//
//  Created by 黄德玉 on 2019/11/2.
//  Copyright © 2019 DCloud. All rights reserved.
//

#import "AppDelegate+IM.h"

@implementation AppDelegate (IM)


- (void)IM_configWithApplication:(UIApplication *)application andOptions:(NSDictionary *)launchOptions{
//    [[NSNotificationCenter defaultCenter] addObserver:self
//                                        selector:@selector(didReceiveMessageNotification:)
//                                                    name:RCKitDispatchMessageNotification
//                                                  object:nil];
}

- (void)IM_config_msg{
    [[RCIM sharedRCIM] initWithAppKey:RONGCLOUD_IM_APPKEY];
    // 设置语音消息采样率为 16KHZ
//       [RCIMClient sharedRCIMClient].sampleRate = RCSample_Rate_16000;
//       [RCIMClient sharedRCIMClient].voiceMsgType = RCVoiceMessageTypeHighQuality;
       
//       //设置会话列表头像和会话页面头像
//       [[RCIM sharedRCIM] setConnectionStatusDelegate:self];
//       [RCIM sharedRCIM].receiveMessageDelegate = self;
//       [RCIM sharedRCIM].enablePersistentUserInfoCache = YES;
//       [RCIM sharedRCIM].userInfoDataSource = RCDDataSource;
//       [RCIM sharedRCIM].groupUserInfoDataSource = RCDDataSource;
//       [RCIM sharedRCIM].groupInfoDataSource = RCDDataSource;
//       [RCIM sharedRCIM].groupMemberDataSource = RCDDataSource;
//       [RCContactCardKit shareInstance].contactsDataSource = RCDDataSource;
//       [RCContactCardKit shareInstance].groupDataSource = RCDDataSource;
//       [RCIM sharedRCIM].globalConversationPortraitSize = CGSizeMake(46, 46);
//       [RCIM sharedRCIM].enableTypingStatus = YES;
//       [RCIM sharedRCIM].enabledReadReceiptConversationTypeList =
//       @[ @(ConversationType_PRIVATE), @(ConversationType_GROUP) ];
//       [RCIM sharedRCIM].enableSyncReadStatus = YES;
//       [RCIM sharedRCIM].showUnkownMessage = YES;
//       [RCIM sharedRCIM].showUnkownMessageNotificaiton = YES;
//       [RCIM sharedRCIM].enableMessageMentioned = YES;
//       [RCIM sharedRCIM].enableMessageRecall = YES;
//       [RCIM sharedRCIM].isMediaSelectorContainVideo = YES;
//       [RCIMClient sharedRCIMClient].logLevel = RC_Log_Level_Info;
//       [RCIM sharedRCIM].enableSendCombineMessage = YES;
}

// 接收到IM消息
- (void)didReceiveMessageNotification:(NSNotification *)notification{
    
}


// 连接状态发生变化
- (void)onRCIMConnectionStatusChanged:(RCConnectionStatus)status {
    
}

// 接收到新消息
- (void)onRCIMReceiveMessage:(RCMessage *)message left:(int)left {
    
}

@end
